import React, { Component } from 'react'
import { Card, Button, message } from 'antd'

class Messages extends Component {

    showSuccess = () => {
        message.success('恭喜你，学习AntD UI框架')
    }

    showMessage = (type) => {
        message[type]('恭喜你，学习AntD UI框架')
    }

    render() {
        return (
            <div className="message-wrap">
                <Card title="全局提示框" className="card-item">
                    <Button type="primary" onClick={this.showSuccess}>Success</Button>
                    <Button type="primary" onClick={() => {this.showMessage('info')}}>Info</Button>
                    <Button type="primary" onClick={() => {this.showMessage('warning')}}>Warning</Button>
                    <Button type="primary" onClick={() => {this.showMessage('error')}}>Error</Button>
                    <Button type="primary" onClick={() => {this.showMessage('loading')}}>Loading</Button>
                </Card>
            </div>
        )
    }
}

export default Messages